const User = {
  Token: sessionStorage.getItem('token') || '', //token
};
export default function reducer(state = User, action: { type: string; token: string }) {
  const { type, token } = action;
  switch (type) {
    case 'setToken':
      sessionStorage.setItem('token', token);
      return { ...state, Token: token };
    default:
      return state;
  }
}
